package com.anbang.app.ui.guide

import android.os.Bundle
import com.anbang.app.R
import com.anbang.app.base.activity.BaseActivity
import kotlinx.android.synthetic.main.activity_guide.*

class GuideActivity : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_guide)

        val layoutIds = arrayOf(R.layout.fragment_guide_0, R.layout.fragment_guide_1, R.layout.fragment_guide_2)
        //
        viewPager.offscreenPageLimit = 3

        //todo  巨坑 这特么 明明就是new 了两个类实例出来 肯定 互相拿不到数据
        //viewPager.setPageTransformer(true, GuideViewPageTransformer())
        //viewPager.addOnPageChangeListener(GuideViewPageTransformer())

        val listener = GuideViewPageTransformer()
        viewPager.setPageTransformer(true, listener)
        viewPager.addOnPageChangeListener(listener)
        viewPager.adapter = GuideViewPagerAdapter(supportFragmentManager, layoutIds)
    }
}
